<html>
<!--[if lt IE 7]>
<html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>
<html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>
<html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js"> <!--<![endif]-->
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>${vote.voteTitle}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Free HTML5 Template by FREEHTML5.CO"/>
    <meta name="keywords" content="free html5, free template, free bootstrap, html5, css3, mobile first, responsive"/>
    <meta name="author" content="FREEHTML5.CO"/>

    <!-- Facebook and Twitter integration -->
    <meta property="og:title" content=""/>
    <meta property="og:image" content=""/>
    <meta property="og:url" content=""/>
    <meta property="og:site_name" content=""/>
    <meta property="og:description" content=""/>
    <meta name="twitter:title" content=""/>
    <meta name="twitter:image" content=""/>
    <meta name="twitter:url" content=""/>
    <meta name="twitter:card" content=""/>

    <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
    <link rel="shortcut icon" href="favicon.ico">

    <!-- Google Webfonts -->
    <link href='http://fonts.useso.com/css?family=Roboto:400,300,100,500' rel='stylesheet' type='text/css'>
    <link href='http://fonts.useso.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>

    <link rel="stylesheet" href="${request.contextPath}/css/weui.min.css">
    <!-- Animate.css -->
    <link rel="stylesheet" href="${request.contextPath}/css/animate.css">
    <!-- Icomoon Icon Fonts-->
    <link rel="stylesheet" href="${request.contextPath}/css/icomoon.css">
    <!-- Magnific Popup -->
    <link rel="stylesheet" href="${request.contextPath}/css/magnific-popup.css">
    <!-- Salvattore -->
    <link rel="stylesheet" href="${request.contextPath}/css/salvattore.css">
    <!-- Theme Style -->
    <link rel="stylesheet" href="${request.contextPath}/css/style.css">
    <!-- Modernizr JS -->
    <script src="${request.contextPath}/js/modernizr-2.6.2.min.js"></script>

    <!-- FOR IE9 below -->
    <!--[if lt IE 9]>
    <script src="${request.contextPath}/js/respond.min.js"></script>
    <![endif]-->

    <style>
        .disabled {
            background-color: #999999;
        }
    </style>

</head>
<body>

<#--<div id="fh5co-offcanvass">-->
<#--<a href="#" class="fh5co-offcanvass-close js-fh5co-offcanvass-close">Menu <i class="icon-cross"></i> </a>-->
<#--<h1 class="fh5co-logo"><a class="navbar-brand" href="index.html">Hydrogen</a></h1>-->
<#--<ul>-->
<#--<li class="active"><a href="index.html">Home</a></li>-->
<#--<li><a href="about.html">About</a></li>-->
<#--<li><a href="pricing.html">Pricing</a></li>-->
<#--<li><a href="contact.html">Contact</a></li>-->
<#--</ul>-->
<#--<h3 class="fh5co-lead">Connect with us</h3>-->
<#--<p class="fh5co-social-icons">-->
<#--<a href="#"><i class="icon-twitter"></i></a>-->
<#--<a href="#"><i class="icon-facebook"></i></a>-->
<#--<a href="#"><i class="icon-instagram"></i></a>-->
<#--<a href="#"><i class="icon-dribbble"></i></a>-->
<#--<a href="#"><i class="icon-youtube"></i></a>-->
<#--</p>-->
<#--</div>-->
<header id="fh5co-header" role="banner">
    <div class="container">
        <div class="row">
            <div class="col-md-12">
            <#--<a href="#" class="fh5co-menu-btn js-fh5co-menu-btn">更多 <i class="icon-menu"></i></a>-->
                <a class="navbar-brand" href="#">${vote.voteSubject}</a>
            </div>
        </div>
    </div>
</header>
<!-- END .header -->
<div id="fh5co-main" style="margin-bottom: 5rem">
    <div class="container">
        <div class="row">
            <div class="col-md-8 col-md-offset-2">
                <div class="fh5co-spacer fh5co-spacer-sm"></div>
                <div class="row">
                    <div class="col-md-4">
                        <div class="fh5co-pricing-table">
                            <h4>活动规则</h4>
                            <div>${vote.voteRule}</div>
                        <#--<a href="#" class="btn btn-block btn-sm btn-outline">Sign up</a>-->
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div>
                            <h5>离投票结束还有:</h5>
                            <table class="item_table">
                                <tbody>
                                <tr>
                                    <td>候选项 : ${vote.optionsCnt}</td>
                                    <td>投票数: ${vote.voteCnt}</td>
                                <#--<td>查看数: 203</td>-->
                                </tr>
                                </tbody>
                            </table>
                        <#--<a href="#" class="btn btn-block btn-sm btn-primary">Sign up</a>-->
                        </div>
                    </div>

                </div>
            </div>
        </div>

        <div class="row">
            <div id="fh5co-board" data-columns>
            <#list vote.options as option>
                <div class="item">
                    <form id="optionFm${option.optionId}">
                        <input type="hidden" name="optionId" value="${option.optionId}">
                        <input type="hidden" name="voteId" value="${option.voteId}">
                    </form>
                    <div><strong>${option.optionNumber}. ${option.optionTitle}</strong></div>
                    <div class="animate-box">
                        <a href="${request.contextPath}${option.imgUrl}"
                           class="image-popup fh5co-board-img"
                           title="${option.attr2}">
                            <img src="${request.contextPath}${option.imgUrl}" alt="${option.optionTitle}">
                        </a>
                    </div>
                    <#if option.describe??>
                        <div class="fh5co-desc">${option.describe}</div></#if>
                    <div class="vote-btn">
                        <input type="radio" name="selectRadio" value="${option.optionId}">
                        得票数: ${option.votes}
                        排名: ${option.rank}
                    </div>
                </div>
            </#list>
            </div>
        </div>
    </div>
</div>

<#--<footer id="fh5co-footer ">-->
<#--<div class="container">-->
<#--<div class="row">-->
<div class="ui-fixed-bottom">
    <a href="javascript:;" class="weui-btn weui-btn_primary" id="voteBtn">投票</a>
</div>
<#--</div>-->
<#--</div>-->
<#--</footer>-->


<!-- jQuery -->
<script src="${request.contextPath}/js/jquery.min.js"></script>
<!-- jQuery Easing -->
<script src="${request.contextPath}/js/jquery.easing.1.3.js"></script>
<!-- Bootstrap -->
<script src="${request.contextPath}/js/bootstrap.min.js"></script>
<!-- Waypoints -->
<script src="${request.contextPath}/js/jquery.waypoints.min.js"></script>
<!-- Magnific Popup -->
<script src="${request.contextPath}/js/jquery.magnific-popup.min.js"></script>
<!-- Salvattore -->
<script src="${request.contextPath}/js/salvattore.min.js"></script>
<!-- Main JS -->
<script src="${request.contextPath}/js/main.js"></script>

<script src="${request.contextPath}/js/jweixin-1.0.0.js"></script>

<script>
    $('#voteBtn').on('click', function () {
        var $that = $(this);
        if ($that.hasClass('disabled')) return;
        var val = $('input:radio[name="selectRadio"]:checked').val()
        var param = $('#optionFm' + val).serialize();
        $.post('vote/doActive.do', param, function (data) {
            if (data.success) {
                flag = 0;
                $that.text('已投票').addClass('disabled').removeClass('weui-btn_primary');
            }
        });
    });
</script>
<script>
    wx.config({
        debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
        appId: '${wxConfig.appId}', // 必填，公众号的唯一标识
        timestamp:'${wxConfig.timestamp}' , // 必填，生成签名的时间戳
        nonceStr: '${wxConfig.nonceStr}', // 必填，生成签名的随机串
        signature: '${wxConfig.signature}',// 必填，签名，见附录1
        jsApiList: ['onMenuShareAppMessage','onMenuShareTimeline'] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
    });

    wx.ready(function () {
        var send_data = {
            title: '分享',
            desc: '描述',
            link: 'http://baidu.com',
            imgUrl:'',
            dataUrl:'',
            success:function () {
                 alert('success');
            },
            cancel:function () {
                alert("cancel");
            }
        }

        wx.onMenuShareAppMessage(send_data);
        wx.onMenuShareTimeline(send_data);

    })
</script>
</body>
</html>
